home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Psygnosis Promotional CD-ROM for E3 1998
/
Psygnosis Promotional CD-ROM for E3 1998.iso
/
introseq.dir
/
00022_Script_Image Script
< prev
next >
Wrap
Text File
|
1998-05-08
|
2KB
|
74 lines
property startPos, endPos, mySprite, myImage, stepMax, stepCount, triggerStep
property distH, distV, startRad, listH, listV
global ■, baseCount, gWhichList, gAction
-----------------------------------
on new me, theSprite, whichMember
set mySprite = theSprite
set myImage = the name of member whichMember
set the member of sprite mySprite to member myImage
RETURN me
end new
-----------------------------------
on setFlyInfo me, startPoint, endPoint, numberOfSteps, triggerCount, accelOrDecel
set stepMax = numberOfSteps
set stepCount = 1
set triggerStep = triggerCount
set startPos = startPoint
set endPos = endPoint
-----
if accelOrDecel = #accelerate then
set startRad = ■/2
else if accelOrDecel = #decelerate then
set startRad = 0
end if
-----
set distPoint = endPoint - startpoint
set distH = getAt(distPoint, 1)
set distV = getAt(distPoint, 2)
calculatePositions
end setFlyInfo
-----------------------------------
on calculatePositions
set proportionList = []
set accumProportionList = []
set totalProportion = 0
repeat with n = 1 to stepMax
set myRad = startRad + (■/2/stepMax*n)
set myProportion = sin(myRad)
set totalProportion = totalProportion + myProportion
append proportionList, myProportion
append accumProportionList, totalProportion
end repeat
-----
set listH = []
set totalDistH = 0
set listV = []
set totalDistV = 0
-----
repeat with n = 1 to stepMax
set myAccumProportion = getAt(accumProportionList, n)
set myDistH = integer((myAccumProportion/totalProportion) * distH)
set myDistV = integer((myAccumProportion/totalProportion) * distV)
append listH, myDistH
set totalDistH = totalDistH + myDistH
append listV, myDistV
set totalDistV = totalDistV + myDistV
end repeat
-----
end calculatePositions
-----------------------------------
on fly me
if (baseCount >= triggerStep) AND (stepCount <= count(listH)) then
set myH = getAt(listH, stepCount) + getAt(startPos, 1)
set myV = getAt(listV, stepCount) + getAt(startPos, 2)
set the loc of sprite mySprite to point(myH, myV)
set stepCount = stepCount + 1
updateStage
else if (stepCount > count(listH)) then
set lastObj = getAt(gWhichList, count(gWhichList))
if (me = lastObj) then
prepareNextAction
end if
end if
end fly